package org.orbis.term.chopper.impl;

import org.orbis.term.Term;
import org.orbis.term.TermList;
import org.orbis.term.chopper.Chopper;
import org.orbis.term.tool.StringConverter;


public class UnigramChopper implements Chopper{
	private static final String stopWord = " 　！!＄$％%’\'（(）)、,。.・／/￥\\；;：:「[{」]}＠@＜<＞>～~";

	@Override
	public TermList chop(String content){
		content = StringConverter.convert(content);
		
		if(content == null) return null;
		TermList terms = new TermList(content.length());

		for(int i = 0; i < content.length(); i++){
			CharSequence subst = content.substring(i, i + 1);
			if (!stopWord.contains(subst)){
				terms.add(new Term(subst.toString()));
			}
		}

		return terms;
	}

}
